const http = require('http')

var server = http.createServer(function(req, res) {
  console.log('linked', req.url);

  switch(req.url) {
    case '/1' :
      res.write('11111111')
      break;
    case '/2':
      res.write('222222222')
      break;
    default:
      res.write('404')
      break;
  }

  res.end();
})

server.listen('8080', function(err) {
  if (err) {
    console.log(err)
    return
  }
  console.log('runing');

});